import React from 'react'
import ReactDOM from 'react-dom'
import {Router, hashHistory} from 'react-router'
import {Provider} from 'react-redux'
import routes from './Routes'
import configureStore from './global/store/store'
import {injectReducer} from './global/reducers'
import reducer from './global/actions'

const store = configureStore(window.___INITIAL_STATE__)

injectReducer(store, {key: 'common', reducer})

ReactDOM.render(
  <Provider store={store}>
    <Router history={hashHistory} routes={routes(store)}/>
  </Provider>,
  document.getElementById('root')
)
